import axios from '@/utils/request'
export function sysUser(params) {
  return axios({
    url: '/sys/user',
    params
  })
}
// 新增员工
export function sysuserPost(data) {
  return axios({
    url: '/sys/user',
    method: 'post',
    data
  })
}
// 删除员工
export function sysuserDelete(id) {
  return axios({
    url: '/sys/user/' + id,
    method: 'delete'
  })
}
// 导入员工
export function sysUserbatch(data) {
  return axios({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
// 定义新的api
export function sysUserPut(data) {
  return axios({
    url: '/sys/user/' + data.id,
    method: 'put',
    data
  })
}
// 获取员工个人信息
export function employeesPersonalInfoPut(id) {
  return axios({
    url: `/employees/${id}/personalInfo`
  })
}
// 更新员工个人信息
export function employeesPersonalInfoPutt(data) {
  return axios({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'put',
    data
  })
}
// 获取岗位详情
export function employeesJobs(id) {
  return axios({
    url: `/employees/${id}/jobs`
  })
}
// 获取员工岗位信息
export function employeesJobsPut(data) {
  return axios({
    url: `/employees/${data.userId}/jobs`,
    method: 'put',
    data
  })
}
// 给员工分配角色 /sys/user/assignRoles
export function sysUserassignRoles(id, roleIds) {
  return axios({
    url: '/sys/user/assignRoles',
    method: 'put',
    data: {
      id,
      roleIds
    }
  })
}
